package com;

import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.bean.Course;
import com.opensymphony.xwork2.ActionSupport;
import com.service.CourseService;


public class ModifyCourse extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Resource(type=Course.class)
	private Course course;
	
	@Autowired
	@Qualifier("courseService")
	private CourseService courseService;

	
	public void setCourse(Course course) {
		this.course = course;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String execute() throws Exception {
		try 
		{
			setCourse(courseService.getCourseById(course.getId()));
			return SUCCESS;
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
			return ERROR;
		}

	}

}
